import ctypes
libc = ctypes.CDLL('libc.so.6')
a = libc.atoi('3.14159268')
buf = ctypes.create_string_buffer(' '*30)
libc.snprintf(buf, 30, "pi is %d (more or less)", a)
print buf.value
from ctypes import *
xlib = CDLL('libX11.so')
libgl = CDLL('libGL.so')
display = xlib.XOpenDisplay(':0.0')
major = c_int()
minor = c_int()
libgl.glXQueryVersion(c_void_p(display), byref(major), byref(minor))
print major.value, minor.value
